<template>
    <div class="container">
        <el-dialog v-model="visible" title="反日结确认" center :show-close="false" :before-close="handleCancel">
            <div class="content-box">
                请确认是否反日结？
            </div>
            <div class="footer-box">
                <el-button class="cancel" @click="handleCancel">取消</el-button>
                <el-button class="submit" @click="handleSubmit">确认</el-button>
            </div>
        </el-dialog>
    </div>
</template>
  
<script setup>
import Api from '@/api'

const props = defineProps({
    visible: {
        type: Boolean,
        required: false,
    },
})
const visible = toRef(props, 'visible')

// 取消
const emit = defineEmits(['emitCancel', 'emitSubmit',])
const handleCancel = () => {
    emit('emitCancel', 'cancel')
}
// 确认
const handleSubmit = () => {
    Api.Common.PcObjProcess.Do({ "functionName": "BackDailySettle", "contentData": {} })
    .then(res => {
      ElNotification({
        title: '提示',
        message: '反日结成功',
        type: 'success',
      })
    })

    emit('emitSubmit', 'submit')
}

</script>
  
<style  lang="scss" scoped>
.container {
    ::v-deep {
        .el-dialog__header {
            font-family: Microsoft YaHei;
            font-weight: bold;
            font-size: 24px;
            color: #212121;
        }

        .el-dialog {
            width: 450px;
            height: 250px;
            background: #FFFFFF;
            border-radius: 16px;
        }
    }

    .content-box {
        margin-top: 10px;
        padding: 0 35px;
        font-family: Microsoft YaHei;
        // font-weight: bold;
        font-size: 16px;
        color: #212121;
    }

    .footer-box {
        margin-top: 40px;
        display: flex;
        justify-content: center;

        .cancel {
            width: 160px;
            height: 60px;
            background: #FFFFFF;
            border-radius: 8px;
            border: 1px solid #FF6A00;
            font-size: 24px;
            color: #FF6A00;
        }

        .submit {
            width: 160px;
            height: 60px;
            background: #FF6A00;
            border-radius: 8px;
            font-size: 24px;
            color: #FFFFFF;
            margin-left: 30px;
        }
    }
}
</style>
  